package featuremodel.constraint;

import java.util.Vector;

import featuremodel.FeatureGroup;
import featuremodel.FeatureModelDef;
import featuremodel.method.ExcludeCompositeMethodUnbind;
import skyblue.Method;
import skyblue.Strength;

public class ExcludeCompositeConstraint extends CompositeConstraint {
	private Vector<Method> methods1;

	public ExcludeCompositeConstraint(FeatureGroup featureGroup1,
			String g1Type, FeatureGroup featureGroup2, String g2Type,
			Strength strength) {

		super(strength);
		this.constraintType = FeatureModelDef.EXCLUDE_COMPLEX_CONSTRAINT;
		getVariables().addAll(featureGroup1.getVariables());
		getVariables().addAll(featureGroup2.getVariables());

		if(methods1!=null){
			methods1.clear();
		}
	
		setGroupPredicFalse(featureGroup1, g1Type);
		methods1 = getTempMethods();
		for (int i = 0; i < methods1.size(); i++) {
			getMethods().add(new ExcludeCompositeMethodUnbind(methods1.get(i)));
		}

		if(methods1!=null){
			methods1.clear();
		}
		setGroupPredicFalse(featureGroup2, g2Type);
		methods1 = getTempMethods();
		for (int j = 0; j < methods1.size(); j++) {
			getMethods().add(new ExcludeCompositeMethodUnbind(methods1.get(j)));

		}

	}
}
